import Vue from 'vue'
import VueRouter from 'vue-router'
// import ContainerView from '@/views/example11/ContainerView'
import LoginView from '@/views/example11/LoginView'
// import NotFoundView from '@/views/example11/NotFoundView'

Vue.use(VueRouter)

const routes = [
  //跳转路由
  {
    path:'/',
    component: () =>import('@/views/example11/ContainerView'), // 容器组件
    children:[
      {
        path:'/c/p1',
        component: () =>import('@/views/example11/container/P1View.vue')
      },
      {
        path:'/c/p2',
        component: () =>import('@/views/example11/container/P2View.vue')
      },
      {
        path:'/c/p3',
        component: () =>import('@/views/example11/container/P3View.vue')
      }
    ]
  },
  {
    path:'/login',
    component: LoginView // 登录组件
  },
  {
    path:'/404',
    component: () =>import('@/views/example11/NotFoundView')// 404组件，动态导入
  },
  /* 没有匹配的路径时，跳转到404 */
  // {
  //   path:'*',
  //   redirect:'/404'
  // }
  

]

const router = new VueRouter({
  routes
})

export default router
